package com.jiazixuan.stock.mapper;

import com.jiazixuan.stock.pojo.entity.SysPermission;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 17127
* @description 针对表【sys_permission(权限表（菜单）)】的数据库操作Mapper
* @createDate 2025-08-14 11:17:57
* @Entity com.jiazixuan.stock.pojo.entity.SysPermission
*/
public interface SysPermissionMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysPermission record);

    int insertSelective(SysPermission record);

    SysPermission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysPermission record);

    int updateByPrimaryKey(SysPermission record);

    /**
     * 根据角色id获取权限集合
     * @param roleId
     * @return
     */
    List<SysPermission> getPermissionByRoleId(@Param("roleId") List<Long> roleId);

    /**
     * 获取所有的权限
     * @return
     */
    List<SysPermission> getAllPermission();


    //添加权限
    int addPerms(@Param("addPerms") SysPermission sysPermission);

    //更新权限
    int updatePerms(@Param("addPerms") SysPermission sysPermission);

    int findChildrenCountByParentId(@Param("permissionId") String permissionId);
}
